fix: remove unreachable return in ensureUriEncoded#963
fix: remove unreachable return in ensureUriEncoded#963braveocheretovych wants to merge 1 commit intohttp-party:masterfrom
Conversation
|
It surprised me that this was just like that when the function was introduced - I thought the earlier return was likely to have been from a bug fix that was done later. That said, what are the consequences of fixing it? Does this Also, why was this implemented at all? The test uses > encodeURI('http://localhost:8080/file?\x0cfoo')
'http://localhost:8080/file?%0Cfoo'
> ensureUriEncoded('http://localhost:8080/file?\x0cfoo')
'http://localhost:8080/file?%0Cfoo'I'm leaning toward using |
|
Good point. With the early return text the function currently does nothing, since the second return is unreachable. Removing it simply restores the intended behavior of encoding characters matched by nonUrlSafeCharsRgx. I also tested the example above and it produces the same result as encodeURI |
Remove unreachable return that prevented URI encoding.